'''
Created on 2011-06-28

@author: Mikael
'''
#from inspect import 


def GetAllVariable(obj):
    '''
    Get all variable from an object
    '''
    attList = dir(obj)
    varList = list()
    
    for item in attList:
        att = getattr(obj, item)
        if not callable(att):
            varList.append(item)

    return varList
    

def GetAllFunctions(obj):
    '''
    Get all functions from an object
    '''
    attList = dir(obj)
    varList = list()
    
    for item in attList:
        att = getattr(obj, item)
        if callable(att):
            varList.append(item)

    return varList
            

def GetAllVariableWithoutUnderscore(obj):
    '''
    Get all variable without underscore from an object
    '''
    attList = dir(obj)
    varList = list()
    
    for item in attList:
        att = getattr(obj, item)
        if not callable(att) and item[:2] != "__":
            varList.append(item)
    
    return varList
            

def GetAllFunctionsWithoutUnderscore(obj):
    '''
    Get all functions without underscore from an object
    '''
    attList = dir(obj)
    varList = list()
    
    for item in attList:
        att = getattr(obj, item)
        if callable(att) and item[:2] != "__":
            varList.append(item)
            
    return varList
